package com.yunji.base.dto;

import com.yunji.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.user.dto
 * @Title: ChangeBindDTO
 * @Description: TODO:
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-07-16 14:49:58      V1.0        HuaAo       新建类
 */

public class ChangeBindDTO implements Serializable {

    private static final long serialVersionUID = -5939017704602801219L;

    private final Map<String, Object> map = new ConcurrentHashMap<>();

    @ApiModelProperty(value = "代理商ID", required = true)
    @Excel(name = "代理商ID", width = 15)
    private Long agentId;

    @ApiModelProperty(value = "旧代理商ID")
    @Excel(name = "旧代理商ID", width = 15)
    private Long previousAgentId;

    @ApiModelProperty(name = "网点ID", required = true)
    @Excel(name = "网点ID", width = 15)
    private Long siteId;

    @ApiModelProperty("经理用户ID")
    @Excel(name = "经理用户ID", width = 15)
    private Long managerId;

    @ApiModelProperty(name = "分润类型", required = true)
    @Excel(name = "分润类型", width = 15)
    private Integer scaleType;

    @ApiModelProperty(name = "分润比例", required = true)
    @Excel(name = "分润比例", width = 15)
    private BigDecimal scale;

    @ApiModelProperty("网点所属ID")
    private Long belongId;

    @ApiModelProperty("代理所属ID")
    private Long parentId;

    public Long getPreviousAgentId() {
        return previousAgentId;
    }

    public void setPreviousAgentId(Long previousAgentId) {
        this.previousAgentId = previousAgentId;
    }

    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public Long getSiteId() {
        return siteId;
    }

    public void setSiteId(Long siteId) {
        this.siteId = siteId;
    }

    public Long getManagerId() {
        return managerId;
    }

    public void setManagerId(Long managerId) {
        this.managerId = managerId;
    }

    public Integer getScaleType() {
        return scaleType;
    }

    public void setScaleType(Integer scaleType) {
        this.scaleType = scaleType;
    }

    public BigDecimal getScale() {
        return scale;
    }

    public void setScale(BigDecimal scale) {
        this.scale = scale;
    }

    public Long getBelongId() {
        return belongId;
    }

    public void setBelongId(Long belongId) {
        this.belongId = belongId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public void set(String k, Object v) {
        if (k == null || v == null) {
            return;
        }
        map.putIfAbsent(k, v);
    }

    @SuppressWarnings("unchecked")
    public <T> T get(String k) {
        if (!map.containsKey(k)) {
            return null;
        }
        return (T) map.get(k);
    }

    @Override
    public String toString() {
        return "ChangeBindDTO{" +
                "agentId=" + agentId +
                ", previousAgentId=" + previousAgentId +
                ", siteId=" + siteId +
                ", managerId=" + managerId +
                ", scaleType=" + scaleType +
                ", scale=" + scale +
                ", belongId=" + belongId +
                ", parentId=" + parentId + '}';
    }
}